package rpc.core;

import java.util.List;
import rpc.bootstrap.spring.RefererBean;
import rpc.bootstrap.spring.RegistryBean;
import rpc.bootstrap.spring.ServiceBean;
import rpc.core.plugin.Plugin;
import rpc.core.registry.RegistryItem;

public interface Registry extends Plugin {

  /****
   * 注册
   * @param serviceBean  提供的服务
   * @param registryBean  注册配置
   */
  void register(ServiceBean serviceBean, RegistryBean registryBean);

  /*****
   * 注销
   * @param serviceBean  提供的服务
   * @param registryBean  注册配置
   */
  void deregister(ServiceBean serviceBean, RegistryBean registryBean);

  /*****
   * 发现服务
   * @param refererBean  引用分为
   * @param registryBean  注册配置
   */
  List<RegistryItem> discover(RefererBean refererBean, RegistryBean registryBean);
}
